<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<% 
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path;
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script type="text/javascript" src="<%=basePath %>/resource/js/common-css-js.js" charset="UTF-8"></script>
<title>修改账号信息</title>
</head>
<body>
<form class="layui-form">
  <input type="hidden" name="userId"/>
  <div class="layui-form-item">
      <select name="userRole" lay-verify="required">
      </select>
  </div>
  <div class="layui-form-item">
      <select name="userDepartment" lay-verify="required">
      </select>
  </div>
  <div class="layui-form-item">
      <input type="text" name="useAuthor" required  lay-verify="required" placeholder="账号持有人" autocomplete="off" class="layui-input">
  </div>
  <div class="layui-form-item">
      <input type="text" name="userLinkMethod" required  lay-verify="required|phone" placeholder="号主联系方式" autocomplete="off" class="layui-input">
  </div>
  <div class="layui-form-item layui-form-text">
      <textarea name="userRemark" placeholder="请输入备注内容" class="layui-textarea"></textarea>
  </div>
  <%@include file="/admin/commonsPage/submit-reset.html" %>
</form>
<script type="text/javascript">

	var roleList = parent.role
	var departmentList = parent.department;
	var currentUserInfo = parent.cTable.bootstrapTable('getSelections');
	
	var roleElement = $("[name='userRole']");
	var departmentElement = $("[name='userDepartment']");
	
	renderSelectedOption(departmentElement,departmentList,currentUserInfo.userDepartment);
	renderSelectedOption(roleElement,roleList,currentUserInfo.userRole);
	
	//回现其他的数据
	for(var key in currentUserInfo[0]){
		$("input[name='"+key+"']").val(currentUserInfo[0][key]);
	}
	
	requestUpdateData("/user")
</script>
</body>
</html>